
import config from "./config";
var domain = config.getDomain;
var DUIXIN_BANNER_ID = config.getDUIXIN_BANNER_ID;
var DUIXIN_CATS_ID = config.getDUIXIN_CATS_ID;
var pageCount = config.getPageCount;
var categoriesID = config.getCategoriesID;

var DUIXIN_API =  domain + '/index.php?v=1&appid='+config.getAPPID+'&appsecret='+config.getAPPSECRET+'&';

module.exports = {
	// 站点
	getWwwUrl: function() {
		return DUIXIN_API;
	},
	// banner轮播图 
	getSwiperUrl: function() {
		return DUIXIN_API+'&s=httpapi&id='+DUIXIN_BANNER_ID;
	},
	// 首页图标
	getTubiaoUrl: function () {
	  var url = DUIXIN_API + '&s=tubiao&c=search&api_call_function=module_list&pagesize';
	  return url;
	},
	// 圈子首页列表
	getQuanindexUrl: function (obj) {
	  var url = DUIXIN_API + '&s=httpapi&id=3'+ '&page=' + obj.page;
	  return url;
	},
	// 圈子列表
	getQuanlistUrl: function () {
	  var url = DUIXIN_API + '&s=httpapi&id=4';
	  return url;
	},
	// 热门列表
	getRemenlistUrl: function (obj) {
	  var url = DUIXIN_API + '&s=httpapi&id=5'+ '&page=' + obj.page;
	  return url;
	},
	// 文章列表
	getListUrl: function (obj) {
	  var url = DUIXIN_API + '&s=news&c=search&api_call_function=module_list&pagesize=' + pageCount + '&page=' + obj.page;
	
	  if (obj.categories != 0) {
	    url += '&catid=' + obj.categories;
	  } else if (obj.search != '') {
	    url += '&keyword=' + encodeURIComponent(obj.search);
	  }
	  return url;
	},
	getTopUrl: function (obj) {
	  var url = DUIXIN_API + '&order=hits&s=news&c=search&api_call_function=module_list&&pagesize=' + pageCount + '&page=' + obj.page;
	
	return url;
	},
	// 文章内容页
	getShowUrl: function (id) {
		return DUIXIN_API + '&s=news&c=show&api_call_function=module_show&id=' + id;
	},  //获取分类列表
	getCategoryUrl: function (ids) {
		return DUIXIN_API+'&s=httpapi&id='+DUIXIN_CATS_ID;
	},

	

};